﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using projetoFinal.Models;
using projetoFinal.Persistência;

namespace projetoFinal.Controllers
{
    [Authorize]
    public class PaginaController : Controller
    {
        [HttpPost]
        public ActionResult CadastroFisico(CadastroFisico cadastroFisico)
        {
            try
            {
                //bd.AddToTABELA(cadastroFisico);
                //bd.SaveChanges();

                return Redirect("/Home/Index");
                // return RedirectToAction("/Home/Index");
            }
            catch
            {
                return View();
            }
        }

        [HttpPost]
        public ActionResult CadastroJuridico(CadastroJuridico cadastroJuridico)
        {
            try
            {
                //bd.AddToTABELA(cadastroJuridico);
                //bd.SaveChanges();

                return Redirect("/Home/Index");
                // return RedirectToAction("/Home/Index");
            }
            catch
            {
                return View();
            }
        }

        [HttpPost]
        public ActionResult Plano(Plano plano)
        {
            try
            {
                //bd.AddToTABELA(plano);
                //bd.SaveChanges();

                return Redirect("/Home/Index");
                // return RedirectToAction("/Home/Index");
            }
            catch
            {
                return View();
            }
        }

        public ActionResult Contrato(Contrato contrato)
        {
            try
            {
                //bd.AddToTABELA(contrato);
                //bd.SaveChanges();

                return Redirect("/Home/Index");
                // return RedirectToAction("/Home/Index");
            }
            catch
            {
                return View();
            }
        }

        //public ActionResult ConsultaFisica(string nome)
        //{
        //    var fisica = from A in bd.TABELA
        //                 orderby A.Nome ascending
        //                 select A;

        //    return View(fisica.ToList());
        //}

        //public ActionResult ConsultaJuridico(string nome)
        //{
        //    var juridica = from A in bd.TABELA
        //                   orderby A.Nome ascending
        //                   select A;

        //    return View(fisica.ToList());
        //}

        //public ActionResult ConsultaPlano(string nome)
        //{
        //    var plano = from A in bd.TABELA
        //                orderby A.Nome ascending
        //                select A;

        //    return View(fisica.ToList());
        //}

        //public ActionResult ConsultaContrato(string nome)
        //{
        //    var contrato = from A in bd.TABELA
        //                   orderby A.Nome ascending
        //                   select A;

        //    return View(fisica.ToList());
        //}
    }
}
